package com.loto.insurance.oem.web.entity.webservice;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.loto.insurance.oem.web.entity.config.OEMConfig;
import com.loto.insurance.oem.web.enumeration.ConfigFileEnum;
import com.loto.insurance.oem.web.utils.Config;

@XmlRootElement
public class Base {
  private OEMConfig config;

  private String acc;

  private String pin;

  private String id;

  public Base() {
	this.acc = getConfig().getOemAcc();
	this.pin = getConfig().getOemPin();
	this.id = getConfig().getOemId();
  }

  @XmlElement(name = "acc")
  public String getAcc() {
	return acc;
  }

  public void setAcc(String acc) {
	this.acc = acc;
  }

  @XmlElement(name = "pin")
  public String getPin() {
	return pin;
  }

  public void setPin(String pin) {
	this.pin = pin;
  }

  @XmlElement(name = "id")
  public String getId() {
	return id;
  }

  public void setId(String id) {
	this.id = id;
  }

  public OEMConfig getConfig() {
	if (config != null)
	  return config;
	else {
	  Config config = new Config();
	  return config.getConfigFile(ConfigFileEnum.OEMCONFIG, OEMConfig.class);
	}
  }
}
